import axios from '@/utils/axios'

export const getUserInfo = (): Promise<ApiResult<UserInfo>> => {
    return axios.get(`base/userinfo`)
}

export const getMenuInfo = (roleId: string): Promise<ApiResult<Array<MenuInfo>>> => {
    return axios.get(`base/menuinfo/${roleId}`)
}

export const getCodeInfo = (): Promise<ApiResult<Array<CodeInfo>>> => {
    return axios.get(`base/codeinfo`)
}

export const login = (params: BaseUser): Promise<ApiResult<string>> => {
    return axios.post(`login`, {}, { params })
}

export const logout = (): Promise<ApiResult<null>> => {
    return axios.post(`logout`)
}

